using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
[CreateAssetMenu(menuName = "Game/Scroll Data/WeaponScrollData/WeaponScrollData List", fileName = "WeaponScrollData List")]
[Serializable]
public class WeaponScrollDataListSO : ScriptableObject
{
    public WeaponScrollDataSO[] itemListData;
        
#if UNITY_EDITOR
    [ContextMenu("Auto-fill with all WeaponScrollData")]
    public void CollectItemData()
    {
        string[] guids = AssetDatabase.FindAssets("t:WeaponScrollDataSO");
        itemListData = guids
                    .Select(guid => AssetDatabase.LoadAssetAtPath<WeaponScrollDataSO>(AssetDatabase.GUIDToAssetPath(guid)))
                    .Where(weaponItem => weaponItem != null)
                    .ToArray();
        EditorUtility.SetDirty(this);
        AssetDatabase.SaveAssets();
    }
#endif
}
